<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<input type="text" name="password" onkeyup="test(this)"></input>
		
	</body>
</html>
<script>
		document.onkeypress= function(event){
			var ev = window.event ||event;
			var key = ev.keyCode;
			alert(key);
		}
		document.onkeydown = function(event){
			var ev = window.event ||event;
			var key = ev.keyCode;
			alert(key);
		}
		function test(obj){
			obj.value  = obj.value.toUpperCase();
		}
</script>
